package controllers

import (
	"context"
	beego "github.com/beego/beego/v2/server/web"
	"week/models"
)

type BlickListController struct {
	beego.Controller
}

func (b *BlickListController) Blick() {
	anchor := b.GetString("anchor")
	userid := b.GetString("userid")
	key := anchor + "blick:" + userid
	models.Redis.Set(context.Background(), key, "黑名单", 0)
	b.Data["json"] = map[string]interface{}{
		"code": 200,
		"msg":  "添加黑名单成功",
	}
	b.ServeJSON()
}
